gtk4.git
6 years agogi: Skip gtk_custom_layout_new()
Emmanuele Bassi [Tue, 11 Feb 2020 17:29:56 +0000 (17:29 +0000)]
gi: Skip gtk_custom_layout_new()

The whole GtkCustomLayout class is mostly a C convenience API, and
there's no reason why high level languages should use it.

6 years agoFix the function name in the gtk-doc stanza
Emmanuele Bassi [Tue, 11 Feb 2020 17:28:18 +0000 (17:28 +0000)]
Fix the function name in the gtk-doc stanza

The documentation is still referring to the old function's name.

6 years agoMatch argument name between declaration and definition
Emmanuele Bassi [Tue, 11 Feb 2020 17:26:51 +0000 (17:26 +0000)]
Match argument name between declaration and definition

Otherwise the documentation and the introspection data will complain.

6 years agodocs: Match the argument name with its declaration
Emmanuele Bassi [Tue, 11 Feb 2020 17:25:44 +0000 (17:25 +0000)]
docs: Match the argument name with its declaration

6 years agoAdd a notify function to GdkContentProvider
Emmanuele Bassi [Tue, 11 Feb 2020 17:24:01 +0000 (17:24 +0000)]
Add a notify function to GdkContentProvider

The callback-based content providers need a GDestroyNotify function to
free the data passed to them on construction, otherwise they are going
to leak.

6 years agoRemove border-half-pixel reftest from xfail
Matthias Clasen [Thu, 13 Feb 2020 14:39:27 +0000 (09:39 -0500)]
Remove border-half-pixel reftest from xfail

It passes both locally and on ci now.

6 years agoMerge branch 'wip/otte/no-clip-on-draw' into 'master'
Matthias Clasen [Thu, 13 Feb 2020 13:43:59 +0000 (13:43 +0000)]
Merge branch 'wip/otte/no-clip-on-draw' into 'master'

Various fixes to rendernode drawing with Cairo

See merge request GNOME/gtk!1425

6 years agogdk: Remove gdk_cairo_get_clip_rectangle()
Benjamin Otte [Wed, 12 Feb 2020 22:45:51 +0000 (23:45 +0100)]
gdk: Remove gdk_cairo_get_clip_rectangle()

The function is fundamentally broken for unbounded surfaces.
If a surface is unbounded, we cannot represent this as a
cairo_rectangle_int_t, and using the return value doesn't work because
it's already used for something else.

In GTK3, unbounded surfaces aren't a problem, but GTK4 uses recording
surfaces.

So better remove that function before we keep using it and using it
wrong.

6 years agocairoblur: Get rid of gdk_cairo_get_clip_rectangle() call
Benjamin Otte [Thu, 13 Feb 2020 01:48:19 +0000 (02:48 +0100)]
cairoblur: Get rid of gdk_cairo_get_clip_rectangle() call

It's about to be removed.

6 years agogsk: Clip shadow node before push_group()
Benjamin Otte [Thu, 13 Feb 2020 00:53:12 +0000 (01:53 +0100)]
gsk: Clip shadow node before push_group()

We want to be sure to push a group that's as small as possible, so we
clip to the child's bounds, because that's the smallest we can go.

6 years agogsk: Add a utility function for rectangles
Benjamin Otte [Thu, 13 Feb 2020 00:48:03 +0000 (01:48 +0100)]
gsk: Add a utility function for rectangles

... and use it.

6 years agocairoblur: Move the check for early exit
Benjamin Otte [Wed, 12 Feb 2020 23:14:29 +0000 (00:14 +0100)]
cairoblur: Move the check for early exit

That means we only have one place where we check all kinds of early
exits.

6 years agorendernode: Avoid rounding errors
Benjamin Otte [Wed, 12 Feb 2020 17:44:11 +0000 (18:44 +0100)]
rendernode: Avoid rounding errors

Compute the pattern matrix directly instead of transforming the cairo_t.

This ensures that when node_size / texture_size is some obscure floating
point value, we don't get rounding issues from scaling by it once we
draw the texture_size rectangle.

I have no actual failure where this comes in handy, but I had written
the code anyway, so decided to keep it.

6 years agotestsuite: Add tests for rounded rect code
Benjamin Otte [Thu, 13 Feb 2020 04:23:31 +0000 (05:23 +0100)]
testsuite: Add tests for rounded rect code

... including the bug that was fixed in the parent commit.

6 years agoroundedrect: Fix inlining of graphene functions
Benjamin Otte [Thu, 13 Feb 2020 06:33:18 +0000 (07:33 +0100)]
roundedrect: Fix inlining of graphene functions

graphene treats equality for contains() operations as always matching,
so do the same thing.

This is because unlike integer math, floating point cannot do the "as
close as possible to the point, but not reaching it" operation that
integer does by just subtracting 1.

6 years agoroundedrect: Fix gsk_rounded_rect_intersects_rect()
Benjamin Otte [Thu, 13 Feb 2020 04:21:49 +0000 (05:21 +0100)]
roundedrect: Fix gsk_rounded_rect_intersects_rect()

The previous code would return FALSE for
  gsk_rounded_rect_intersects_rect (&rounded, &rounded.bounds);
if rounded was indeed rounded.

6 years agotestsuite: Don't use gdk_cairo_get_clip_rectangle()
Benjamin Otte [Wed, 12 Feb 2020 22:44:09 +0000 (23:44 +0100)]
testsuite: Don't use gdk_cairo_get_clip_rectangle()

I want to remove it.

6 years agotestsuite: Don't destroy surfaces that are still used
Benjamin Otte [Thu, 13 Feb 2020 02:23:51 +0000 (03:23 +0100)]
testsuite: Don't destroy surfaces that are still used

Coercing the surfaces must not unref the old surface, because the old
surface is going to be saved to a file.

6 years agotestsuite: Remove accidentally checked in file
Benjamin Otte [Thu, 13 Feb 2020 05:14:05 +0000 (06:14 +0100)]
testsuite: Remove accidentally checked in file

This file should go in the listview branch I guess.

6 years agoFix flickery hover
Matthias Clasen [Thu, 13 Feb 2020 03:45:24 +0000 (22:45 -0500)]
Fix flickery hover

Commit 47c44644b109e0 was a bit overzealous in fixing
compiler warnings. We still need to call collect_textures,
even if we don't need the number that it returns.

6 years agoMerge branch 'wip/baedert/cairo-paint' into 'master'
Matthias Clasen [Wed, 12 Feb 2020 23:44:38 +0000 (23:44 +0000)]
Merge branch 'wip/baedert/cairo-paint' into 'master'

Remove cairo_clip() when drawing render nodes

Closes #2431

See merge request GNOME/gtk!1418

6 years agoRemove unused signal enum values
Matthias Clasen [Wed, 12 Feb 2020 23:24:59 +0000 (18:24 -0500)]
Remove unused signal enum values

GtkWidget lost even more signals, so we don't need
these enum values anymore.

6 years agopopovermenu: Avoid an uninitialized variable
Matthias Clasen [Wed, 12 Feb 2020 22:58:41 +0000 (17:58 -0500)]
popovermenu: Avoid an uninitialized variable

Pointed out by Timm/clang.

Fixes https://gitlab.gnome.org/GNOME/gtk/issues/2434

6 years agoMerge branch 'ci-pages' into 'master'
Matthias Clasen [Wed, 12 Feb 2020 22:35:58 +0000 (22:35 +0000)]
Merge branch 'ci-pages' into 'master'

Rename the SCSS files for our themes

Closes #2423

See merge request GNOME/gtk!1423

6 years agoRename the SCSS files for our themes
Emmanuele Bassi [Wed, 12 Feb 2020 20:18:27 +0000 (20:18 +0000)]
Rename the SCSS files for our themes

It seems that Meson's gnome.compile_resources() cannot deal with two
files with the same name under different directories, which breaks the
build parallelism because the GResource file ends up not depending on
either the Adwaita or the HighContrast gtk-contained.css file.

This commit only changes the on-disk names of the Adwaita and
HighContrast SCSS files, and the corresponding generated CSS files; the
files in the GResource are going to be aliased to the old file names, to
minimise the breakage. We might want to change the theme entry points at
some later date, if we decide to commit to this naming scheme.

Fixes: #2423
See Meson bug: https://github.com/mesonbuild/meson/issues/6615

6 years agoFix the Emoji chooser finalize
Matthias Clasen [Wed, 12 Feb 2020 19:23:01 +0000 (14:23 -0500)]
Fix the Emoji chooser finalize

If the Emoji chooser is finalized before the idle
has run, it would spew criticals, breaking some tests.
Avoid that.

6 years agoMerge branch 'gbsneto/fix-emojichooser-header' into 'master'
Georges Basile Stavracas Neto [Wed, 12 Feb 2020 18:56:19 +0000 (18:56 +0000)]
Merge branch 'gbsneto/fix-emojichooser-header' into 'master'

build: Install gtkemojichooser.h

See merge request GNOME/gtk!1420

6 years agobuild: Install gtkemojichooser.h
Georges Basile Stavracas Neto [Wed, 12 Feb 2020 18:41:49 +0000 (15:41 -0300)]
build: Install gtkemojichooser.h

It was made public at ef7172dc1ee86a, but the header file
wasn't added to the public headers list.

Add the header file to the list.

6 years agoMerge branch 'ci-pages' into 'master'
Emmanuele Bassi [Wed, 12 Feb 2020 18:38:39 +0000 (18:38 +0000)]
Merge branch 'ci-pages' into 'master'

Small CI pipeline fixes

See merge request GNOME/gtk!1419

6 years agoci: Update flatpak job
Emmanuele Bassi [Wed, 12 Feb 2020 18:21:00 +0000 (18:21 +0000)]
ci: Update flatpak job

Use `flatpak build` and point at the nightly repo when generating the
bundle.

6 years agoci: Deploy the API ref before flatpak
Emmanuele Bassi [Wed, 12 Feb 2020 18:10:49 +0000 (18:10 +0000)]
ci: Deploy the API ref before flatpak

6 years agoci: Fix linking of the CI assets in the report
Emmanuele Bassi [Wed, 12 Feb 2020 18:03:48 +0000 (18:03 +0000)]
ci: Fix linking of the CI assets in the report

The report is relative to the build directory, and so are the generated
assets.

6 years agotestsuite: Warn if a necessary env var is missing
Matthias Clasen [Tue, 11 Feb 2020 19:09:24 +0000 (14:09 -0500)]
testsuite: Warn if a necessary env var is missing

Better to warn if we know why the tests are
going to fail. Saves headscratching later.

6 years agoMove performance tests to the right testsuite
Matthias Clasen [Tue, 11 Feb 2020 19:09:00 +0000 (14:09 -0500)]
Move performance tests to the right testsuite

This was a copy-paste error.

6 years agorendernode: Don't clip when _draw()ing
Timm Bäder [Wed, 12 Feb 2020 15:22:44 +0000 (16:22 +0100)]
rendernode: Don't clip when _draw()ing

6 years agorendernode: draw() only in node bounds
Timm Bäder [Wed, 12 Feb 2020 15:21:38 +0000 (16:21 +0100)]
rendernode: draw() only in node bounds

We currently disable when draw()ing nodes using the cairo fallback path,
which means we can't just use cairo_paint(). Use a proper rectangle
instead.

Fixes #2431

6 years agoMerge branch 'cleanup-profiler-marks' into 'master'
Matthias Clasen [Wed, 12 Feb 2020 14:31:40 +0000 (14:31 +0000)]
Merge branch 'cleanup-profiler-marks' into 'master'

Cleanup profiler marks

See merge request GNOME/gtk!1417

6 years agoprofile: Use separate names for frameclock marks instead of using details
Alexander Larsson [Wed, 12 Feb 2020 13:26:16 +0000 (14:26 +0100)]
profile: Use separate names for frameclock marks instead of using details

The marks are averaged based on the name, so this makes more sense.

Also rename the map/unmap marks to have the same capitalization as
everything else.

6 years agoprofiler: Add G_GNUC_PRINTF markers to silence warnings
Alexander Larsson [Wed, 12 Feb 2020 12:35:42 +0000 (13:35 +0100)]
profiler: Add G_GNUC_PRINTF markers to silence warnings

I was getting CI failures like:
 ../gdk/gdkprofiler.c: In function ‘add_markvf’:
../gdk/gdkprofiler.c:111:3: error: function ‘add_markvf’ might be a candidate for ‘gnu_printf’ format attribute [-Werror=suggest-attribute=format]

6 years agoprofiler: Clean up profiler marks for frameclock
Alexander Larsson [Wed, 12 Feb 2020 12:20:32 +0000 (13:20 +0100)]
profiler: Clean up profiler marks for frameclock

This drops the marks for before/after-paint as they are internal
things that very rarely use any time, and also flush/resume-events
as any events reported here will get separate marks so will be easy
to see anyway.

Also, we rename the entire frameclock cycle to "frameclock cycle"
rather than "paint_idle" which is rather cryptic.

6 years agoprofiler: Add profiler marks for when surfaces are mapped and unmapped
Alexander Larsson [Wed, 12 Feb 2020 11:44:43 +0000 (12:44 +0100)]
profiler: Add profiler marks for when surfaces are mapped and unmapped

This is done on the X11 side so we can tell when the map/unmap takes
effect and how long it took since the map request.

6 years agoicon theme: Don't add profiler marks for short async icon loads
Alexander Larsson [Wed, 12 Feb 2020 11:43:27 +0000 (12:43 +0100)]
icon theme: Don't add profiler marks for short async icon loads

We do a bunch of preloads, and most of these are not really interesting
anyway.

6 years agobuilder: Don't add profiler marks for short parses
Alexander Larsson [Wed, 12 Feb 2020 11:42:29 +0000 (12:42 +0100)]
builder: Don't add profiler marks for short parses

There are a lot of thes (since we're recursing), so don't spew the
output with uninteresting ones.

6 years agoprofiler: Add _end_mark() version of _add_mark()
Alexander Larsson [Wed, 12 Feb 2020 10:25:34 +0000 (11:25 +0100)]
profiler: Add _end_mark() version of _add_mark()

These don't take a duration, instead they call g_get_monotonic_time() to
and subtract the start time for it.

Almost all our calls are like this, and this makes the callsites clearer
and avoids inlining the clock call into the call site.

6 years agoprofiler: Make profiler-is-running a macro
Alexander Larsson [Wed, 12 Feb 2020 10:05:01 +0000 (11:05 +0100)]
profiler: Make profiler-is-running a macro

When we use if (GDK_PROFILER_IS_RUNNING) this means we get an
inlined if (FALSE) when the compiler support is not compiled in, which
gets rid of all the related code completely.

We also expand to  G_UNLIKELY(gdk_profiler_is_running ()) in the supported
case which might cause somewhat better code generation.

6 years agoConvert all profiler times from nsec to usec
Alexander Larsson [Wed, 12 Feb 2020 09:44:17 +0000 (10:44 +0100)]
Convert all profiler times from nsec to usec

usec is the scale of the monotonic timer which is where we get almost
all the times from. The only actual source of nsec is the opengl
GPU time (but who knows what the actual resulution of that is).

Changing this to usec allows us to get rid of " * 1000" in a *lot* of
places all over the codebase, which are ugly and confusing.

6 years agoUse markf in one more place
Alexander Larsson [Wed, 12 Feb 2020 09:40:26 +0000 (10:40 +0100)]
Use markf in one more place

6 years agofixup! Add gdk_profiler_add_markf() to do printf formating
Alexander Larsson [Wed, 12 Feb 2020 09:11:53 +0000 (10:11 +0100)]
fixup! Add gdk_profiler_add_markf() to do printf formating

6 years agoUse the new gdk_profiler_add_markf() function
Alexander Larsson [Wed, 12 Feb 2020 08:59:03 +0000 (09:59 +0100)]
Use the new gdk_profiler_add_markf() function

6 years agoAdd gdk_profiler_add_markf() to do printf formating
Alexander Larsson [Wed, 12 Feb 2020 08:56:10 +0000 (09:56 +0100)]
Add gdk_profiler_add_markf() to do printf formating

This allows us to avoid hand-rolling g_strdup_printf calls,
but also moves the printf into the called function where
it doesn't bloat the code of the calling function if the profiler
is not running.

6 years agoUpdate Esperanto translation
Carmen Bianca BAKKER [Wed, 12 Feb 2020 07:43:58 +0000 (07:43 +0000)]
Update Esperanto translation

6 years agoMerge branch 'mark-events-with-kind' into 'master'
Matthias Clasen [Tue, 11 Feb 2020 19:01:10 +0000 (19:01 +0000)]
Merge branch 'mark-events-with-kind' into 'master'

profiler: Always mark events with the kind

See merge request GNOME/gtk!1414

6 years agoprofiler: Always mark events with the kind
Alexander Larsson [Tue, 11 Feb 2020 18:51:49 +0000 (19:51 +0100)]
profiler: Always mark events with the kind

6 years agoMerge branch 'wip/baedert/outline-radius' into 'master'
Matthias Clasen [Tue, 11 Feb 2020 16:59:11 +0000 (16:59 +0000)]
Merge branch 'wip/baedert/outline-radius' into 'master'

css boxes: Compute box from border box

Closes #2425

See merge request GNOME/gtk!1408

6 years agoMerge branch 'share-gl-programs' into 'master'
Emmanuele Bassi [Tue, 11 Feb 2020 16:30:16 +0000 (16:30 +0000)]
Merge branch 'share-gl-programs' into 'master'

GskGLRenderer: Share programs between different renderers in same display

See merge request GNOME/gtk!1413

6 years agoMerge branch 'handle-max-texture-size' into 'master'
Matthias Clasen [Tue, 11 Feb 2020 16:23:02 +0000 (16:23 +0000)]
Merge branch 'handle-max-texture-size' into 'master'

gl: Don't require too large texture for offsreen ops

See merge request GNOME/gtk!1411

6 years agoMerge branch 'fix-angle-normalization' into 'master'
Matthias Clasen [Tue, 11 Feb 2020 16:17:14 +0000 (16:17 +0000)]
Merge branch 'fix-angle-normalization' into 'master'

gsk: Fix angle normalization

See merge request GNOME/gtk!1409

6 years agoGskGLRenderer: Share programs between different renderers in same display
Alexander Larsson [Tue, 11 Feb 2020 15:56:24 +0000 (16:56 +0100)]
GskGLRenderer: Share programs between different renderers in same display

This is similar to how we share texture atlases. Some added complexity
in that the program state also needed to be shared, so it had to move to
the shared Programs object.

With this change realization of additional GskRenderers when opening
popups went from ~60msec to ~35 msec on average.

6 years agoMerge branch 'ci-jobs' into 'master'
Emmanuele Bassi [Tue, 11 Feb 2020 15:25:48 +0000 (15:25 +0000)]
Merge branch 'ci-jobs' into 'master'

Update CI jobs

See merge request GNOME/gtk!1412

6 years agoci: Allow release job to fail
Emmanuele Bassi [Tue, 11 Feb 2020 15:12:14 +0000 (15:12 +0000)]
ci: Allow release job to fail

We need to investigate release-specific failures, and possibly fix our
test suite to deal with debug-specific poking through the internal
state.

For the time being, allow the release job to fail, but this is strictly
a temporary measure.

6 years agotestsuite/gtk: Add xfail tests
Emmanuele Bassi [Tue, 11 Feb 2020 14:53:57 +0000 (14:53 +0000)]
testsuite/gtk: Add xfail tests

Some tests are expected to fail.

Some tests are expected to fail in non-debugging builds.

The icontheme test is the latter.

6 years agovulkan: Handle VK_ERROR_UNKNOWN
Emmanuele Bassi [Tue, 11 Feb 2020 14:07:43 +0000 (14:07 +0000)]
vulkan: Handle VK_ERROR_UNKNOWN

A newly added Vulkan 1.2 error.

6 years agoci: Add a style check pass
Emmanuele Bassi [Tue, 11 Feb 2020 13:28:16 +0000 (13:28 +0000)]
ci: Add a style check pass

We should at least try to get the style check done by a machine, as
opposed to have humans go through merge requests with coding style
nitpicks.

6 years agoci: Generate the report for the release builds
Emmanuele Bassi [Wed, 29 Jan 2020 13:36:23 +0000 (14:36 +0100)]
ci: Generate the report for the release builds

We are going to need to hide the report generation into the test runner
script, as we want the job to produce the reports even in case of
failure, instead of bailing out immediately.

6 years agoDeclare global counters only in debug builds
Emmanuele Bassi [Wed, 29 Jan 2020 13:03:56 +0000 (14:03 +0100)]
Declare global counters only in debug builds

6 years agoSilence compiler warnings in non-debug builds
Emmanuele Bassi [Wed, 29 Jan 2020 13:02:41 +0000 (14:02 +0100)]
Silence compiler warnings in non-debug builds

6 years agoDeclare global counter only in debug builds
Emmanuele Bassi [Wed, 29 Jan 2020 13:02:16 +0000 (14:02 +0100)]
Declare global counter only in debug builds

6 years agoMerge branch 'fix-revealer-scale' into 'master'
Matthias Clasen [Tue, 11 Feb 2020 14:06:36 +0000 (14:06 +0000)]
Merge branch 'fix-revealer-scale' into 'master'

revealer: Fix child size allocation at small scales

See merge request GNOME/gtk!1410

6 years agoci: Add missing newline escape
Emmanuele Bassi [Wed, 29 Jan 2020 11:31:00 +0000 (12:31 +0100)]
ci: Add missing newline escape

Otherwise we're going to run the accessibility test suite, and it's
going to fail.

6 years agoci: Remove static build job
Emmanuele Bassi [Wed, 29 Jan 2020 11:23:06 +0000 (12:23 +0100)]
ci: Remove static build job

Now that we figured out why the build was failing on Fedora when the
profiling code was enabled, we can go back to building both shared and
static libraries by default.

6 years agoci: Use the new Fedora image
Emmanuele Bassi [Wed, 29 Jan 2020 11:18:09 +0000 (12:18 +0100)]
ci: Use the new Fedora image

6 years agoci: Add static packages for GLib and PCRE
Emmanuele Bassi [Wed, 29 Jan 2020 11:16:44 +0000 (12:16 +0100)]
ci: Add static packages for GLib and PCRE

Otherwise Meson will warn about missing static dependencies for
sysprof-capture-3.

6 years agoFix compiler warnings in the release build
Emmanuele Bassi [Wed, 29 Jan 2020 11:00:48 +0000 (12:00 +0100)]
Fix compiler warnings in the release build

We have a bunch of debug-only variables that get set and never used
outside of debug code paths, and the compiler is not happy about it.

6 years agoci: Disable ccache
Emmanuele Bassi [Wed, 29 Jan 2020 10:45:33 +0000 (11:45 +0100)]
ci: Disable ccache

6 years agoInitialise out variable
Emmanuele Bassi [Wed, 29 Jan 2020 10:34:11 +0000 (11:34 +0100)]
Initialise out variable

Otherwise we might return an undefined value, and the compiler will be
very cross at us.

6 years agoci: Split the static and shared builds (again)
Emmanuele Bassi [Wed, 29 Jan 2020 10:31:47 +0000 (11:31 +0100)]
ci: Split the static and shared builds (again)

Sadly, we can't do a static build with the profiling code enabled
because we don't have a static GLib build available.

6 years agoci: Replicate the CI image scripts from GLib
Emmanuele Bassi [Wed, 29 Jan 2020 10:01:10 +0000 (11:01 +0100)]
ci: Replicate the CI image scripts from GLib

They are easier to use and document, and allow us to add new base images
in the future without making a mess.

6 years agoci: Refactor the CI pipeline
Emmanuele Bassi [Wed, 29 Jan 2020 09:35:10 +0000 (10:35 +0100)]
ci: Refactor the CI pipeline

We should have a single job for building both static and shared
versions of GTK. On the other hand, having a separate job for the
release build would be a plus.

Additionally, we shouldn't use an opaque script to build GTK; the only
step in the process that requires hand-holding is running the tests
suites under Xvfb, and having the build options visible from the YAML
file gives us a better idea of what kind of build we're running.

6 years agoci: Use release builds for Flatpak bundles
Emmanuele Bassi [Wed, 29 Jan 2020 09:34:41 +0000 (10:34 +0100)]
ci: Use release builds for Flatpak bundles

6 years agotests/frame-stats.c: Include stdlib.h
Chun-wei Fan [Tue, 11 Feb 2020 12:46:19 +0000 (20:46 +0800)]
tests/frame-stats.c: Include stdlib.h

It is used for exit().

6 years agorevealer: Fix child size allocation at small scales
Alexander Larsson [Tue, 11 Feb 2020 11:22:34 +0000 (12:22 +0100)]
revealer: Fix child size allocation at small scales

As pointed out in https://gitlab.gnome.org/GNOME/gtk/issues/1481
and seen from critical warnings with swinging revealers in widget-factory
there are some size allocation issues in GtkRevealer.

What happens is that we request a size of the revealer itself
based on the child natural size and the current stage of the transition
by applying a scale to the natural size. We then round up to nearest
int size. However, we want the widget to render as if it did get the
natural size so we can transform it, rather than the scaled down size.
For example, a label should not start ellipsizing in the animation.
So we inverse the scale when allocating the child.

Unfortunately, for very small scales the inversion of the scale can
result in very large sizes, and for such scales we rounded up the
requested size to 1, so we will be allocating huuuuge children.

In order to avoid such issue we pick an arbitrary maximum upscale
scale factor of 100. This means that in the case where the allocated
size is 1 we never allocate the child at > 100 px. This means
that in large downscaling cases we may run into the clipping issue
described above. However, at these downscaling levels (100 times!)
we're unlikely to notice much detail anyway.

6 years agogsk: Fix angle normalization
Alexander Larsson [Tue, 11 Feb 2020 09:00:34 +0000 (10:00 +0100)]
gsk: Fix angle normalization

I was getting assertions that normalize_angle() failed the
result < 260 check. Doing some research on this it turns out
to be a precision issue. If the incomming angle is very slightly
below zero, then adding 360 to it may end up with exactly 360.

I simplified the code a bit to avoid division and rounding, because in
practice most angles will be "just outside" the 0-360 degree anyway.
And i also added a workaround for the "result is 360" case by just
setting it to 0.

6 years agogl: Don't require too large texture for offsreen ops
Alexander Larsson [Tue, 11 Feb 2020 12:01:27 +0000 (13:01 +0100)]
gl: Don't require too large texture for offsreen ops

When rendering ops to an offscreen texture we take max-texture-size
in consideration and modify the scale we use such that the required
texture does not exceed the limit.

This means some rendering will be blocky/fuzzy, but that is better
than it being clipped.

6 years agoTypo fix
Matthias Clasen [Tue, 11 Feb 2020 12:46:12 +0000 (07:46 -0500)]
Typo fix

6 years agoRevert "Add the label-wrap-justify reftest to xfails"
Matthias Clasen [Tue, 11 Feb 2020 12:44:01 +0000 (07:44 -0500)]
Revert "Add the label-wrap-justify reftest to xfails"

This reverts commit 5e746d35b2c5ab8601b493d4f8ca4784328d50fa.

Turns out label-wrap-justify isn't failing in ci, and this is
now making ci fail :(

6 years agocss boxes: Compute inline box from border box
Timm Bäder [Tue, 11 Feb 2020 07:29:11 +0000 (08:29 +0100)]
css boxes: Compute inline box from border box

We can't just use the outline rect and apply the border radius because
the outline box is the border box grown by the outline offset, which
will also grow the resulting border radius.

Fixes #2425

6 years ago3.98.0
Matthias Clasen [Mon, 10 Feb 2020 20:32:19 +0000 (15:32 -0500)]
3.98.0

6 years agoAdd the label-wrap-justify reftest to xfails
Matthias Clasen [Mon, 10 Feb 2020 20:19:13 +0000 (15:19 -0500)]
Add the label-wrap-justify reftest to xfails

Seems just like the other label tests, down to details
of text rendering.

6 years agoDrop the toplevel-vs-popup reftest
Matthias Clasen [Mon, 10 Feb 2020 20:15:05 +0000 (15:15 -0500)]
Drop the toplevel-vs-popup reftest

Popups look different from toplevels. I don't think
a reftest that tries to prove otherwise has much
leg to stand on.

6 years agoDisable the buttons a11y test
Matthias Clasen [Mon, 10 Feb 2020 20:06:56 +0000 (15:06 -0500)]
Disable the buttons a11y test

The test fails because radio buttons are currently broken.

6 years agoUpdate expected test output
Matthias Clasen [Mon, 10 Feb 2020 20:03:47 +0000 (15:03 -0500)]
Update expected test output

The a11y test for GtkAssistant produces different
output due to headerbar changes.

6 years agocalendar: Fix mismatches with GDateTime
Matthias Clasen [Mon, 10 Feb 2020 19:59:40 +0000 (14:59 -0500)]
calendar: Fix mismatches with GDateTime

GDatetime uses 1-based month and day numbers, whereas
GktCalendars are 0-based. Correct for this.

6 years agoCalendar: Make year/month/day writable again
Matthias Clasen [Mon, 10 Feb 2020 19:14:18 +0000 (14:14 -0500)]
Calendar: Make year/month/day writable again

Our a11y tests were relying on this.

6 years agotestsuite: Update expected output
Matthias Clasen [Mon, 10 Feb 2020 18:55:37 +0000 (13:55 -0500)]
testsuite: Update expected output

The output for combo boxes in a11y tests has changed
because they use popovers now.

6 years agoMerge branch 'fix-gestures-test' into 'master'
Matthias Clasen [Mon, 10 Feb 2020 15:57:54 +0000 (15:57 +0000)]
Merge branch 'fix-gestures-test' into 'master'

Fix gestures test

See merge request GNOME/gtk!1406

6 years agoFix gestures test
Alexander Larsson [Mon, 10 Feb 2020 15:24:03 +0000 (16:24 +0100)]
Fix gestures test

This tests was testing gestures by faking an event in the
middle of a window that has a hbox with an expanding image in it.
For me (and I guess this depends on all sorts of issues like whether
CSD is enabled, font sizes, etc) the hbox ended up centered horizontally
but not vertically (probably because of csd at the top), so no events
ever hit the inner widgets.

This is fixed by emitting the events at allocation.x/y of the
hbox, which should contain both the hbox and the image (as it expands).

6 years agoMerge branch 'fix-hidpi-popups' into 'master'
Matthias Clasen [Mon, 10 Feb 2020 15:08:51 +0000 (15:08 +0000)]
Merge branch 'fix-hidpi-popups' into 'master'

Fix popup placement on hidpi multi-monitor

See merge request GNOME/gtk!1405

6 years agohidpi: Rescan monitors when screen scale factor changes
Alexander Larsson [Mon, 10 Feb 2020 14:19:32 +0000 (15:19 +0100)]
hidpi: Rescan monitors when screen scale factor changes

All the code in e.g. init_randr15() divides the physical resolutions with
the screen scale, however if we get the screen scale from xsettings
rather than e.g. GDK_SCALE the initial setup is using the wrong value.

So, whenever the screen scale size is changed we need to trigger
a re-read of the randr data

6 years agoMerge branch 'mainloop-cleanup' into 'master'
Matthias Clasen [Mon, 10 Feb 2020 14:32:09 +0000 (14:32 +0000)]
Merge branch 'mainloop-cleanup' into 'master'

Mainloop cleanup

See merge request GNOME/gtk!1404

6 years agoMore updates
Matthias Clasen [Mon, 10 Feb 2020 13:13:23 +0000 (08:13 -0500)]
More updates